package com.wtsw.pulsosocial.view.menu;


import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.Button;
import android.widget.ListView;

import com.wtsw.pulsosocial.R;
import com.wtsw.pulsosocial.controller.GestorEventos;
import com.wtsw.pulsosocial.view.event.FormEvento;


public class EventosFragment extends Fragment  {
	  private Button pulse;		  
	
    public static Fragment newInstance(Context context) {
        EventosFragment f = new EventosFragment();
        return f;
    }

    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container,Bundle savedInstanceState) {
        View rootView = inflater.inflate(R.layout.fragment_eventos, container, false);
        
        ListView listEvents = (ListView) rootView.findViewById(R.id.list_events);
        
        listEvents.setAdapter(GestorEventos.generaLista(getActivity()));

        pulse = (Button) rootView.findViewById(R.id.pulse);
        pulse.setOnClickListener(new View.OnClickListener() {
            public void onClick(View v) {
            	startActivity(new Intent(getActivity(), FormEvento.class));    	        
            }
        });
        
        return rootView;
    }

}
